local path "C:\Users\pgi1\Dropbox\Coal 2021 _ Joe Peter\Bank Regressions\"
cd "`path'\data"
set seed 100
set more off
clear

use esgscore092322, clear
replace lupcoid=185984 if lenderup=="Truist Financial"

sum total_esg_score environment_score

rename lupcoid ultimateparentid
rename yr year

keep ultimateparentid year  total_esg_score environment_score social_score governance_score
bysort ultimateparentid year: keep if _n==1
save esg-scores-cleaned.dta, replace
